package com.shuijing.boot.mvc;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;

/**
 * @author 刘水镜
 * @blog https://liushuijinger.blog.csdn.net
 * @date 2020/11/29
 */
@SpringBootApplication
public class MvcApplication {

    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(MvcApplication.class);
        Environment environment = app.run(args).getEnvironment();
        String port = environment.getProperty("server.port", "8080");
        String noannotation = "http://localhost:" + port + "/noannotation?name=无注解方式&age=21";
        String requestParam = "http://localhost:" + port + "/requestparam?name=RequestParam方式&age=22";
        String pathVariable = "http://localhost:" + port + "/pathvariable/PathVariable/23";
        System.out.println("************************************************************");
        System.out.println("* 无注解方式访问地址: " + noannotation);
        System.out.println("* @RequestParam 方式访问地址: " + requestParam);
        System.out.println("* @PathVariable 方式访问地址: " + pathVariable);
        System.out.println("************************************************************");
    }

}
